
local RaceSyncData = {}

function RaceSyncData:new(player,syncManager)
    local o = {
        player = player,
        syncManager = syncManager,
    }
    setmetatable(o,self)
    self.__index = self
    return o
end

function RaceSyncData:onOnline()

end

function RaceSyncData:onOffline()

end

function RaceSyncData:onNotifySync(curFrameId,curFrames)

    local datas = {}
    for _,v in pairs(curFrames) do
        table.insert(datas,{
            index = v.index,
            data = v.data,
        })
    end

    local msg = {
        frames = {
            {
                frame_id = curFrameId,
                datas = datas,
            }
        }
    }

    self.player:sendUdpMessage("MessageId_NotifySyncFrames","MessageNotifySyncFrames",msg)

end


return RaceSyncData